<template>
  <div class="container">
    <div class="person_box">
      <img class="pic" src="">
      <div class="infor">
        ZQ<span>用户名：mmk_123st</span>
      </div>
      <div class="tag">当前登录</div>
    </div>
    <ul class="section">
      <li class="section-item">
        <a href="/pages/package_mine/personalSetting/main">个人资料
          <div class="icon">
            <img :src="base_url+'/jifenshangcheng/xiangqingye/xiayibu@2x.png'"
                 v-if="base_url"
                 class="img">
          </div>
        </a>
      </li>
      <li class="section-item">
        <a href="/pages/package_mine/my_service/main">我的推荐人
          <div class="icon">
            <img :src="base_url+'/jifenshangcheng/xiangqingye/xiayibu@2x.png'"
                 v-if="base_url"
                 alt
                 class="img">
          </div>
        </a>
      </li>
    </ul>
    <ul class="section">
      <li class="section-item">
        <a href="/pages/package_mine/address_list/main">收货地址
          <div class="icon">
            <img :src="base_url+'/jifenshangcheng/xiangqingye/xiayibu@2x.png'"
                 v-if="base_url"
                 class="img">
          </div>
        </a>
      </li>
      <li class="section-item">
        <a href="/pages/package_mine/changeMobile/main">修改手机号
          <div class="icon">
            <img :src="base_url+'/jifenshangcheng/xiangqingye/xiayibu@2x.png'"
                 v-if="base_url"
                 class="img">
          </div>
        </a>
      </li>
      <li class="section-item">
        <a href="/pages/package_mine/about_us/main">关于我们
          <div class="icon">
            <img :src="base_url+'/jifenshangcheng/xiangqingye/xiayibu@2x.png'"
                 v-if="base_url"
                 class="img">
          </div>
        </a>
      </li>
    </ul>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
export default {
  data () {
    return {
      userInfo: "",
      base_url: common.image_resource
    };
  },
  onLoad () {
    wx.setNavigationBarTitle({
      title: "设置"
    });
    this.getData();
  },
  onShow () {
    this.getData();
  },
  methods: {
    callService () {
      wx.makePhoneCall({
        phoneNumber: "400-617-1314"
      });
    },
    to_service () {
      common.to_service()
    },
    clear_storage () {
      wx.clearStorage();
      wx.showToast({
        title: "清除缓存成功",
        icon: "none",
        duration: 2000,
        mask: true,
        success () {
          setTimeout(() => {
            wx.switchTab({ url: '/pages/index/main' });
          }, 1500);
        }
      });
    },
    getData () {
      wx.showLoading({
        title: "加载中", //提示的内容,
        mask: true //显示透明蒙层，防止触摸穿透
      });
      setTimeout(() => {
        common.fly_post("api/v4_5/my_info_detail", {}, result => {
          let res = result.data;
          wx.hideLoading();
          if (res.status_code == 0) {
            wx.setStorageSync("user_data", res.data);
          } else {
            wx.showToast({
              title: res.message,
              icon: "none",
              duration: 2000,
              mask: true
            });
          }
        });
      }, 200);
    }
  }
};
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  background: rgba(243, 244, 246, 1);
  .section {
    width: 100%;
    min-height: 44px;
    margin-bottom: 10px;
    background-color: #fff;
    .section-item {
      height: 44px;
      line-height: 44px;
      padding-left: 15px;
      position: relative;
      a {
        width: 100%;
        height: 100%;
        display: block;
        position: relative;
        font-size: 14px;
        font-family: "Regular";
        color: rgba(102, 102, 102, 1);
        .icon {
          font-size: 14px;
          font-family: "Regular";
          color: rgba(102, 102, 102, 1);
          position: absolute;
          right: 15px;
          top: 50%;
          transform: translateY(-50%);
          text-align: right;
          .img {
            width: 20px;
            height: 20px;
            display: block;
          }
        }
      }
      .btn {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 10;
        opacity: 0;
      }
    }
  }
  .exit-btn {
    width: 285px;
    height: 44px;
    background: linear-gradient(
      180deg,
      rgba(255, 152, 170, 1),
      rgba(246, 70, 101, 1)
    );
    border-radius: 24px;
    line-height: 44px;
    text-align: center;
    margin: 20px auto;
    font-size: 14px;
    font-family: "Regular";
    color: rgba(255, 255, 255, 1);
  }
}
</style>


